extends Sprite2D

class_name BigMapCity

var _label:Label
var _area:Area2D

var _city_entity:CityEntity
var city_entity:CityEntity:
	get:
		return _city_entity
	set(value):
		_city_entity = value
		_label.text = value.city_name

signal city_clicked

func _ready():
	_label = get_node("Label")
	_area = get_node("Area2D")
	_area.input_event.connect(_on_input)
	pass
	

func _on_input(viewport:Node,event:InputEvent,index:int):
	if event is InputEventMouseButton:
		if event.button_index == MOUSE_BUTTON_LEFT && event.is_pressed():
			city_clicked.emit(self)
			pass
		pass
	pass
